package com.zhongmeng.rxjava2test.retrofit


import com.zhongmeng.rxjava2test.bean.Banner
import com.zhongmeng.rxjava2test.bean.BaseBean
import com.zhongmeng.rxjava2test.bean.LoginBean
import com.zhongmeng.rxjava2test.bean.Notice
import com.zhongmeng.rxjava2test.bean.Work

import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query


/**
 * author :rcw.
 * date :2017/10/11 11:41.
 * 网络请求接口
 */

interface ApiService {

    /*@get:GET("")
    val datas: Observable<T>*/

    @get:GET("appHomeController/getImgLsit.do")
    val bannerUrl: Observable<Banner>

    @get:GET("appController/returnToken.do")
    val qiuniuToken: Observable<BaseBean>

    /**
     *
     * @param cid
     * @param username
     * @param password
     * @return 返回类型为observable的实体类
     * @GET 请求可用@Query/QueryMap
     * @POST 请求用@Filed/body(body为对象类型)*必须添加@FormUrlEncoded注解
     */
    @GET("loginController/login.do")
    fun getLoginInfo(@Query("cid") cid: String, @Query("loginid") username: String, @Query("password") password: String): Observable<LoginBean>

    @GET("noticeManageController/getNoticeList.do")
    fun getNoticeInfo(@Query("types") types: String, @Query("page") page: String, @Query("pagesize") pagesize: String, @Query("areacode") areacode: String): Observable<Notice>

    @GET("centerController/cdcBacklog.do")
    fun getCdcWorkInfo(@Query("unitcode") unitcode: String): Observable<Work>

    @GET("superviseController/getBacklog.do")
    fun getWorkInfo(@Query("areacode") areacode: String): Observable<Work>

}
